Skip to content
This repository has been archived by the owner on Mar 18, 2022. It is now read-only.

Update coverage to 6.0.1 #293

Closed
wants to merge 1 commit into from
Closed

Conversation

pyup-bot
Copy link
Collaborator

@pyup-bot pyup-bot commented Oct 8, 2021

This PR updates coverage from 5.5 to 6.0.1.

Changelog

6.0.1

----------------------------

- In 6.0, the coverage.py exceptions moved from coverage.misc to
coverage.exceptions. These exceptions are not part of the public supported
API, CoverageException is. But a number of other third-party packages were
importing the exceptions from coverage.misc, so they are now available from
there again (`issue 1226`_).

- Changed an internal detail of how tomli is imported, so that tomli can use
coverage.py for their own test suite (`issue 1228`_).

- Defend against an obscure possibility under code obfuscation, where a
function can have an argument called "self", but no local named "self"
(`pull request 1210`_).  Thanks, Ben Carlsson.

.. _pull request 1210: https://github.com/nedbat/coveragepy/pull/1210
.. _issue 1226: https://github.com/nedbat/coveragepy/issues/1226
.. _issue 1228: https://github.com/nedbat/coveragepy/issues/1228


.. _changes_60:

6.0

--------------------------

- The ``coverage html`` command now prints a message indicating where the HTML
report was written.  Fixes `issue 1195`_.

- The ``coverage combine`` command now prints messages indicating each data
file being combined.  Fixes `issue 1105`_.

- The HTML report now includes a sentence about skipped files due to
``skip_covered`` or ``skip_empty`` settings.  Fixes `issue 1163`_.

- Unrecognized options in the configuration file are no longer errors. They are
now warnings, to ease the use of coverage across versions.  Fixes `issue
1035`_.

- Fix handling of exceptions through context managers in Python 3.10. A missing
exception is no longer considered a missing branch from the with statement.
Fixes `issue 1205`_.

- Fix another rarer instance of "Error binding parameter 0 - probably
unsupported type." (`issue 1010`_).

- Creating a directory for the coverage data file now is safer against
conflicts when two coverage runs happen simultaneously (`pull 1220`_).
Thanks, Clément Pit-Claudel.

.. _issue 1035: https://github.com/nedbat/coveragepy/issues/1035
.. _issue 1105: https://github.com/nedbat/coveragepy/issues/1105
.. _issue 1163: https://github.com/nedbat/coveragepy/issues/1163
.. _issue 1195: https://github.com/nedbat/coveragepy/issues/1195
.. _issue 1205: https://github.com/nedbat/coveragepy/issues/1205
.. _pull 1220: https://github.com/nedbat/coveragepy/pull/1220


.. _changes_60b1:

6.0b1

----------------------------

- Dropped support for Python 2.7, PyPy 2, and Python 3.5.

- Added support for the Python 3.10 ``match/case`` syntax.

- Data collection is now thread-safe.  There may have been rare instances of
exceptions raised in multi-threaded programs.

- Plugins (like the `Django coverage plugin`_) were generating "Already
imported a file that will be measured" warnings about Django itself.  These
have been fixed, closing `issue 1150`_.

- Warnings generated by coverage.py are now real Python warnings.

- Using ``--fail-under=100`` with coverage near 100% could result in the
self-contradictory message :code:`total of 100 is less than fail-under=100`.
This bug (`issue 1168`_) is now fixed.

- The ``COVERAGE_DEBUG_FILE`` environment variable now accepts ``stdout`` and
``stderr`` to write to those destinations.

- TOML parsing now uses the `tomli`_ library.

- Some minor changes to usually invisible details of the HTML report:

- Use a modern hash algorithm when fingerprinting, for high-security
 environments (`issue 1189`_).  When generating the HTML report, we save the
 hash of the data, to avoid regenerating an unchanged HTML page. We used to
 use MD5 to generate the hash, and now use SHA-3-256.  This was never a
 security concern, but security scanners would notice the MD5 algorithm and
 raise a false alarm.

- Change how report file names are generated, to avoid leading underscores
 (`issue 1167`_), to avoid rare file name collisions (`issue 584`_), and to
 avoid file names becoming too long (`issue 580`_).

.. _Django coverage plugin: https://pypi.org/project/django-coverage-plugin/
.. _issue 580: https://github.com/nedbat/coveragepy/issues/580
.. _issue 584: https://github.com/nedbat/coveragepy/issues/584
.. _issue 1150: https://github.com/nedbat/coveragepy/issues/1150
.. _issue 1167: https://github.com/nedbat/coveragepy/issues/1167
.. _issue 1168: https://github.com/nedbat/coveragepy/issues/1168
.. _issue 1189: https://github.com/nedbat/coveragepy/issues/1189
.. _tomli: https://pypi.org/project/tomli/


.. _changes_56b1:

5.6b1

----------------------------

Note: 5.6 final was never released. These changes are part of 6.0.

- Third-party packages are now ignored in coverage reporting.  This solves a
few problems:

- Coverage will no longer report about other people's code (`issue 876`_).
 This is true even when using ``--source=.`` with a venv in the current
 directory.

- Coverage will no longer generate "Already imported a file that will be
 measured" warnings about coverage itself (`issue 905`_).

- The HTML report uses j/k to move up and down among the highlighted chunks of
code.  They used to highlight the current chunk, but 5.0 broke that behavior.
Now the highlighting is working again.

- The JSON report now includes ``percent_covered_display``, a string with the
total percentage, rounded to the same number of decimal places as the other
reports' totals.

.. _issue 876: https://github.com/nedbat/coveragepy/issues/876
.. _issue 905: https://github.com/nedbat/coveragepy/issues/905


.. _changes_55:
Links

@pyup-bot pyup-bot mentioned this pull request Oct 8, 2021
@pyup-bot
Copy link
Collaborator Author

Closing this in favor of #296

@pyup-bot pyup-bot closed this Oct 12, 2021
@rymurr rymurr deleted the pyup-update-coverage-5.5-to-6.0.1 branch October 12, 2021 03:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant